package com.example.httpdemo.controller;


import com.example.httpdemo.service.HttpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class HttpController {

    @Autowired
    private HttpService httpService;

    @RequestMapping("/")
    public String index(){
        return "hello world";
    }

    @GetMapping("/send")
    public String sendMessage(){
        httpService.sendMessage();
        return "done";
    }


}
